| Miles Sound System SDK 7.2a |
For MIDI output, the Miles Sound System can use the system MIDI hardware through the midiOut API, or it can synthesize the MIDI stream itself and feed it through the digital output system. MIDI is pretty a simple environment.
For digital audio output, however, things are a little more complicated. Miles can be configured to use either DirectSound (the preferred method) or the old waveOut audio system.
DirectSound shipped about a year after Windows 95 first shipped. It has been built into Windows since Windows 98 and Windows 2000.
DirectSound can run in native mode or emulated mode. Native mode means that DirectSound is talking directly to your sound card hardware. Emulated mode means that DirectSound is talking to old waveOut audio drivers (through an extra layer of buffering).
DirectSound in emulation mode usually works terribly. To avoid this (and to support old Win95 and old NT machines that don't have DirectSound at all), Miles can use the old waveOut sound system directly. WaveOut was the original way to play sound in Windows (it was added to Win16 way back as an add-on to Windows 3.0 - yes, audio was once considered a chargeable "add-on" by Microsoft).
WaveOut mode is nice, because it will work on pretty much any machine, but, unfortunately, it has serious latency problems. These latency issues were, in fact, the primary reason Microsoft added DirectSound.
Under waveOut, latency can rise to as high as 300 milliseconds on some older sound cards. DirectSound's latency, by comparison, rarely hits even 50 ms.
In practice, we've found that you usually don't have to worry about supporting old sound cards through waveOut, because a game's graphics usually require the latest Direct3D and/or DirectDraw anyway (so you know DirectSound will be installed).
So, by default, to deal with all of these issues, Miles tries to use DirectSound first, and then falls back to waveOut mode if DirectSound won't load or if it is running in emulation mode. So, you get DirectSound's good latency if running in native mode, and you still get waveOut's compatibility when necessary.
Be sure to review the How do I use multi-channel sound output in Miles? FAQ for an overview of the audio output configurations supported under Win32.
Next Topic (Memory management under Win32)
Previous Topic (Distributing Miles with Win32 Applications)
Group:
Overview for Win32: Miles on Windows XP, Vista, 2000, NT and Win9x
Related FAQs:
How do I use multi-channel sound output in Miles?
For technical support, e-mail Miles3@radgametools.com
© Copyright 1991-2007 RAD Game Tools, Inc. All Rights Reserved.